<?php
/**
* +----------------------------------------------------------------------+
* | Workfile: $Id: addhost.php 37 2005-04-03 05:54:36Z vluther $                                                      | 
* +----------------------------------------------------------------------+
* | Copyright (c) 2000-2004 Linuxpowered, Inc                             |
* +----------------------------------------------------------------------+
* | Author: Vidyut Luther <vid@linuxpowered.com>                         |
* +----------------------------------------------------------------------+
* 
* $Header: /cvsroot/phpbinder/binder/addhost.php,v 1.4 2004/01/02 05:16:01 admin Exp $
**/
require_once('./global.inc.php') ; 
require_once(INCLUDE_PATH."/Records.class.php"); 


$section = "Add a Host"; 
/* Load the domains owned by this user */

$sql = "SELECT fqdnid,fqdn from fqdn where user='$userid'"; 
$rs = $db->mRun($sql) ; 
$fqdns = array(); 
while($row=mysql_fetch_array($rs)) {
    $myfqdns[$row[0]] = $row[1] ; 
}

$mydomain = $_POST['mydomains'];  
$tpl->assign("web_base",WEB_BASE); 

$tpl->assign("myfqdns",$myfqdns) ; 
$tpl->assign("mydomain",$mydomain) ; 

$tpl->assign("section",$section) ; 
$tpl->assign("basedir",BASEDIR) ; 

$tpl->display("header.html"); 


$r = new DNSRecord(); 
$rtypes = $r->mLoadTypes();

/* now get all the records for the domain we're looking at */

$r->mSetId($mydomain);

$domRecords = $r->mLoadRecords();

$tpl->assign("dnsRecords",$domRecords); 
$tpl->assign("rtypes",$rtypes); 
$tpl->display("addhost.html"); 


?>
